{
case VCPUOP_initialise:
if ( (ctxt = xmalloc(struct vcpu_guest_context)) == NULL )
- {
- rc = -ENOMEM;
- break;
- }
+ return -ENOMEM;
if ( copy_from_guest(ctxt, arg, 1) )
{
xfree(ctxt);
- rc = -EFAULT;
- break;
+ return -EFAULT;
}
LOCK_BIGLOCK(d);
case VCPUOP_up:
if ( !test_bit(_VCPUF_initialised, &v->vcpu_flags) )
- rc = -EINVAL;
- else if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
+ return -EINVAL;
+
+ if ( test_and_clear_bit(_VCPUF_down, &v->vcpu_flags) )
vcpu_wake(v);
+
break;
case VCPUOP_down:
{
struct vcpu_set_periodic_timer set;
- rc = -EFAULT;
if ( copy_from_guest(&set, arg, 1) )
- break;
+ return -EFAULT;
- rc = -EINVAL;
if ( set.period_ns < MILLISECS(1) )
- break;
+ return -EINVAL;
v->periodic_period = set.period_ns;
vcpu_force_reschedule(v);
else
cpus_setall(v->cpu_affinity);
- /* Initialise the per-domain timers. */
+ /* Initialise the per-vcpu timers. */
init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
v, v->processor);
init_timer(&v->singleshot_timer, vcpu_singleshot_timer_fn,
#ifndef COMPAT
-/* Per-domain one-shot-timer hypercall. */
+/* Per-vcpu oneshot-timer hypercall. */
long do_set_timer_op(s_time_t timeout)
{
struct vcpu *v = current;